-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(providers): single database mode #1101
base: master
Are you sure you want to change the base?
Conversation
@psav I've opted for "single" as the name of the db mode. Suggestions and reviews are welcome. Thank you. |
0f87516
to
9e4a061
Compare
e0a2a56
to
86ee564
Compare
86ee564
to
5d02dad
Compare
|
||
var pgPassword string | ||
if setAdmin { | ||
pgPassword, err = utils.RandPassword(16, provutils.RCharSet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My initial thought was to disable admin user for apps, however some apps might still require this to do some setups (i.e. create additional users). @psav any suggestions how we should approach this situation? I guess, one of the option is to update those services needing such privileges, or look at the privileges case-by-case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's tricky because ephemeral usage often relies on them needing to do more stuff than usual, but in prod they will just get the credentials which are appropriate
I'm opening this up from a draft state for review. There still might be some small issues in certain conditions. I prefer to get this out sooner to do a bunch of testing on a test cluster. Thank you. |
Creates a new database provider mode named `single`. The aim of the mode is to create a single database instance and share it between the apps by separating them by Posgres schemas. Each app gets a schema created by the name of the requested database. Schemas are created under environment's database, with the same name as the ClowdEnv. RHINENG-14526
5d02dad
to
b7285df
Compare
We should talk about the expectation here and I was thinking we can deploy this for testing in the cluster - without merging it and only merge when we are ready - allows us to not goof up the cluster too much. @bsquizz @wcmitchell |
Creates a new database provider mode named
single
.The aim of the mode is to create a single database instance and share it
between the apps by separating them by Posgres schemas.
Each app gets a schema created by the name of the requested database.
Schemas are created under environment's database, with the same name as
the ClowdEnv.
Adds the following refactorings:
provutils.DefaultPGPort
to set port constantprovutils.DefaultPGAdminUsername
to set default PG admin userprovutils.PGAdminConnectionStr
that builds sanitized connection string to PG from aDatabaseConfig
using admin credsprovutils.ReadDbConfigFromSecret
to reuse read ofDatabaseConfig
s from secrets, optionally using a cacheRHINENG-14526